using System;

namespace PropertyExpression.Common
{
    public static class ActionExtensions
    {
        public static Func<T1, T2, object> ToFunc<T1, T2>(this Action<T1, T2> action)
        {
            return (arg1, arg2) =>
                       {
                           action(arg1, arg2);
                           return null;
                       };
        }

        public static Func<T1, object> ToFunc<T1>(this Action<T1> action)
        {
            return arg =>
                       {
                           action(arg);
                           return null;
                       };
        }

        public static Func<object> ToFunc(this Action action)
        {
            return () =>
                       {
                           action();
                           return null;
                       };
        }
    }
}